package com.algorithm.enums;

import lombok.Getter;

/**
 * @description:  分表
 *
 */
@Getter
public enum SubTable {
    
    t_product_mapping("t_product_mapping_","productMappingStrategy","商品映射关系"),
    t_storage_goods_rel("t_hi_storage_goods_rel_", "storageGoodsRelStrategy", "客户分库与商品关系表"),
    t_product_price("t_customer_product_price_rel_", "productPriceRelStrategy", "客户商品定价表"),
    t_customer_product("t_customer_product_rel_", "customerProductRelStrategy", "客户可供商品表"),
    t_customer_product_supply("t_product_supplier_rel_", "productSupplyRelStrategy", "客户商品供应商关系表"),
    t_customer_placeorder_template_detail("t_customer_placeorder_template_detail_", "customerTemplateDetailStrategy", "客户下单模板详情表"),
    t_stock_order_template_detail("t_stock_order_template_detail_", "stockOrderTemplateDetailStrategy", "门店内部领用明细模板表"),
    t_base_sku_redis("t_base_sku_redis_","baseSkuRedisStrategy", "baseSku的redis分key策略"),
    t_customer_product_period_rel("t_customer_product_period_rel_","customerProductPeriodRelStrategy", "客户物料到货周期表"),
    t_hi_customer_order_temp("t_hi_customer_order_temp_rel_","hiCustomerOrderTempStrategy", "内销客户开货临时表分表策略"),
    t_customer_franchise_price("t_customer_franchise_price_rel_","customerFranchisePriceStrategy", "外销客户加盟价");

    private final String table;
    private final String strategy;
    private final String desc;

    SubTable(String table, String strategy, String desc) {
        this.table = table;
        this.strategy = strategy;
        this.desc = desc;
    }

    public static SubTable get(String table) {
        SubTable o = null;
        for (SubTable value : SubTable.values()) {
            if ( value.getTable().equals(table) ) {
                o = value;
                break;
            }
        }
        return o;
    }
}
